<template>
	<view class="order">
		<view class="head">
			<image :src="baseUrl + '/wximage/order_success.png'"></image>
			<view class="name">{{info.statustitle}}</view>
		</view>
		<view class="detail">
			<view class="title">订单详情</view>
			<view class="price">
				<view class="left fl">
					<view class="name">支付金额</view>
				</view>
				<view class="right fr">
					{{info.money}}元
				</view>
			</view>
			<view class="content">
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">单号：</view>
					</view>
					<view class="right fr">
						{{info.out_order_no}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">租借地点：</view>
					</view>
					<view class="right fr">
						{{info.wdtitle}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">借用设备：</view>
					</view>
					<view class="right fr">
						{{info.charge_number}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">借用卡口：</view>
					</view>
					<view class="right fr">
						{{info.duankou}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">宝编码：</view>
					</view>
					<view class="right fr">
						{{info.charge_bao_sn}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">宝类型：</view>
					</view>
					<view class="right fr" v-if="info.bao_leixing == 1">
						普通宝
					</view>
					<view class="right fr" v-else>
						快充宝
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">开始时间：</view>
					</view>
					<view class="right fr">
						{{info.sdate}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">结束时间：</view>
					</view>
					<view class="right fr">
						{{info.edate}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">使用时长：</view>
					</view>
					<view class="right fr">
						{{info.sjshichang}}
					</view>
				</view>
				<view class="list clearfix">
					<view class="left fl">
						<view class="name">支付方式：</view>
					</view>
					<view class="right fr">
						{{info.pay_type}}
					</view>
				</view>
			</view>
		</view>
		<view class="queren" @click="topage('/pages/index/index')">
			返回首页
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl: getApp().globalData.baseUrl,
				id: '',
				info: {
					status: '',
					statustitle: '',
					money: '',
					out_order_no: '',
					sdate: '',
					wdtitle: '',
					dizhi: '',
					ghwdtitle: '',
					ghdizhi: '',
					charge_number: '',
					duankou: '',
					charge_bao_sn: '',
					bao_leixing: '',
					sjshichang: '',
					pay_type: '',
					edate: '',
					attr: '',
					huiyuan_jmleixing: '',
					huiyuan_jmshichang: '',
					huiyuan_jmjie: '',
					coupons_id: '',
					youhui_jmleixing: '',
					youhui_minus: '',
				},
			}
		},
		onLoad(options) {
			this.id = options.id;
			
			this.request({
				url: '/xcx/orderDetail',
				data: {
					id: this.id,
					agent_id: '',
					role_id: '',
				},
				method: "POST"
			}).then(res => {
				if (res.data.code == 200) {
					this.info = res.data.data;
				} else {
					uni.showToast({
						title: '请求失败，请稍后再试',
						icon: 'none'
					})
				}
			})
		},
		methods: {
			topage(url){
				uni.reLaunch({
					url
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.order{
		width: 100%;
		margin: 0 auto;
		padding-bottom: 40rpx;
		
		.head{
			width: 100%;
			margin: 0 auto;
			text-align: center;
			
			image{
				width: 120rpx;
				height: 120rpx;
				margin-top: 20rpx;
			}
			
			.name{
				font-size: 28rpx;
				color: #333333;
			}
		}
		
		.detail{
			width: 90%;
			margin: 40rpx auto;
			padding: 40rpx 30rpx 0.5rpx;
			box-sizing: border-box;
			background: #F2FFFE;
			border-radius: 20rpx;
			
			.title{
				font-size: 32rpx;
				color: #333333;
				font-weight: 700;
			}
			
			.price{
				height: 100rpx;
				line-height: 100rpx;
				border-bottom: 1rpx solid #D8D8D8;
				
				.name{
					font-size: 24rpx;
					color: #333333;
					font-weight: 700;
				}
				
				.right{
					font-size: 32rpx;
					color: #333333;
					font-weight: 700;
				}
			}
			
			.content{
				width: 100%;
				margin: 0 auto;
				margin-bottom: 40rpx;
				
				.list{
					margin-top: 26rpx;
					line-height: 52rpx;
					
					.left{
						width: 24%;
						
						.name{
							font-size: 24rpx;
							color: #666666;
						}
					}
					
					.right{
						width: 70%;
						text-align: right;
						font-size: 24rpx;
						color: #666666;
					}
				}
			}
		}
		
		.queren{
			width: 90%;
			margin: 0 auto;
			margin-top: 40rpx;
			height: 92rpx;
			line-height: 92rpx;
			text-align: center;
			background: linear-gradient(to bottom, #AFFFF7, #00D6C0);
			border-radius: 46rpx;
			font-size: 36rpx;
			color: #FFFFFF;
			font-weight: 600;
		}
	}
</style>